package org.lql.chaos.common.exception;

import lombok.Getter;
import org.lql.chaos.common.constant.ErrorCode;

/**
 * @author: liangqinglong
 * @date: 2025-07-02 10:24
 * @description:
 **/
@Getter
public class BizException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	private final ErrorCode errorCode;

	public BizException(ErrorCode errorCode) {
		super(errorCode.getMessage());
		this.errorCode = errorCode;
	}

	public BizException(ErrorCode errorCode, String message) {
		super(message);
		this.errorCode = errorCode;
	}

	public BizException(ErrorCode errorCode, String message, Throwable cause) {
		super(message, cause);
		this.errorCode = errorCode;
	}

	public BizException(ErrorCode errorCode, Throwable cause) {
		super(cause);
		this.errorCode = errorCode;
	}

}
